#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
自定义异常类
定义系统中使用的各种异常类型
"""


class StudentManagementError(Exception):
    """学生管理系统基础异常类"""
    pass


# 数据验证异常
class ValidationError(StudentManagementError):
    """数据验证异常"""
    def __init__(self, message: str, field: str = None):
        super().__init__(message)
        self.field = field


# 数据未找到异常
class DataNotFoundError(StudentManagementError):
    """数据未找到异常"""
    def __init__(self, message: str, data_type: str = None):
        super().__init__(message)
        self.data_type = data_type


# 重复数据异常
class DuplicateDataError(StudentManagementError):
    """重复数据异常"""
    def __init__(self, message: str, field: str = None):
        super().__init__(message)
        self.field = field


# 权限异常
class PermissionError(StudentManagementError):
    """权限异常"""
    def __init__(self, message: str, required_role: str = None):
        super().__init__(message)
        self.required_role = required_role


# 文件操作异常
class FileOperationError(StudentManagementError):
    """文件操作异常"""
    def __init__(self, message: str, file_path: str = None):
        super().__init__(message)
        self.file_path = file_path


class AuthenticationError(StudentManagementError):
    """认证异常"""
    pass


class ConfigurationError(StudentManagementError):
    """配置异常"""
    pass


class BusinessLogicError(StudentManagementError):
    """业务逻辑异常"""
    pass
